﻿
--创建表
CREATE TABLE [dbo].[T_Customer] (
    [CustomerId]         UNIQUEIDENTIFIER NOT NULL,
    [CustomerCode]       VARCHAR (100)    NULL,
    [CustomerName]       VARCHAR (200)    NOT NULL,
    [Country]            VARCHAR (100)    NULL,
    [Email]              VARCHAR (500)    NULL,
    [Phone]              VARCHAR (100)    NULL,
    [CompanyName]        VARCHAR (200)    NULL,
    [Skype]              VARCHAR (100)    NULL,
    [Whatsapp]           VARCHAR (100)    NULL,
    [QQ]                 VARCHAR (100)    NULL,
    [Wechat]             VARCHAR (100)    NULL,
    [Webside]            VARCHAR (200)    NULL,
    [Adress]             VARCHAR (1000)   NULL,
    [ProductDescription] VARCHAR (8000)   NULL,
    [CustomerReview]     VARCHAR (8000)   NULL,
    [TargetMarket]       VARCHAR (8000)   NULL,
    [Schedule]           VARCHAR (8000)   NULL,
    [CreateTime]         VARCHAR (20)     NULL,
    [CreateUserId]       INT              NULL,
    [UpdateTime]         VARCHAR (20)     NULL,
    [UpdateUserId]       INT              NULL,
    [Valid]              INT              NULL, 
    CONSTRAINT [PK_T_Customer] PRIMARY KEY ([CustomerId])
);

--修改菜单
update Sys_Module set ModuleName=replace(ModuleName,'手机','产品') where ModuleName like '%手机%'

update T_Classification set ClassificationName=replace(ClassificationName,'手机','产品') 
where ParentId=0 and ClassificationName like '%手机%'


--添加菜单 
insert into Sys_Module([ModuleName],[ModuleCode],[ParentId],[Valid],[Href],[IsLeaf],[OrderNo],[TreeOrderNo],[SysNo])
values('客户信息','003',0,1,'',0,'02','','001')
declare @newid int
select @newid=ModuleId from Sys_Module where [ModuleName]='客户信息'
insert into Sys_Module([ModuleName],[ModuleCode],[ParentId],[Valid],[Href],[IsLeaf],[OrderNo],[TreeOrderNo],[SysNo])
values('客户资料查询','003001',@newid,1,'/Customer/CustomerList.aspx',0,'02','','001')
insert into Sys_Module([ModuleName],[ModuleCode],[ParentId],[Valid],[Href],[IsLeaf],[OrderNo],[TreeOrderNo],[SysNo])
values('客户资料录入','003001Add',@newid,1,'/Customer/CustomerAdd.aspx?Action=Add',0,01,'','001')

select * from Sys_Module
